class TestName(object):
    def __init__(self, name):
        self.name = name

    def sport(self):
        print(f"{self.name}爱运动")

    def dance(self):
        print(f"{self.name}爱跳舞")


xm = TestName("小明")
xm.sport()
xh = TestName('小红')
xm.dance()


# 编写复杂,但是后期运行维护简单